#include <bits/stdc++.h>
// 2025/07/16
// tag:
// Author: Forever
using namespace std;
using int64 = int64_t;

void solve(int a, int b)
{
    int cnt = 0;
    if (a < b)
        swap(a, b);
    while (a / b == 1 && a % b != 0) {
        cnt++;
        a %= b;
        swap(a, b);
    }
    if (cnt & 1)
        cout << "Ollie wins" << endl;
    else
        cout << "Stan wins" << endl;
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin >> t;
    while (t--) {
        int a, b;
        cin >> a >> b;
        solve(a, b);
    }
    return 0;
}